import React, { memo } from "react";
import { useHistory } from "react-router-dom";
import { Barticlewrap } from "./style";
import Titletag from "@/components/titletag";
export default memo(function Barticle(props) {
  const history = useHistory();
  return (
    <Barticlewrap>
      <Titletag imp={"美文分享 "} other={"Share"} color={"#38b3d4"}></Titletag>
      <div className="content1">
        {props.blog.length > 0 &&
          props.blog.slice(0, 4).map((item, index) => {
            return (
              <img
                onClick={(e) =>
                  history.push(`/home/aesthetic/aesathedetail/${item.bgid}`)
                }
                src={item.pic}
                key={index}
                alt=""
              />
            );
          })}
      </div>
      <div className="thenew">
        <span>♡</span>
        <span>最新文章:{props.blog[0] && props.blog[0].title}</span>
        <img
          src="http://www.lmlblog.com/winter/templets/xq/images/new.gif"
          alt=""
        />
      </div>
    </Barticlewrap>
  );
});
